<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>轮播图</title>
</head>
<body>
<img id="mm" src="img/1.jpg" alt="美女图片" style="height: 500px">

<!--需求，没间隔两秒钟换一张图片：轮流显示五张图片-->
<script>
    var picName = 1;
    setInterval(function () {
        picName++;
        if (picName > 5) {
            picName = 1;
        }

        var mm = document.getElementById("mm")
        mm.src = "img/" + picName + ".jpg";
    }, 2000);
</script>






</body>
</html>